<!DOCTYPE html>
<html lang="en" xmlns:th="http://www.thymeleaf.org" xmlns:shiro="http://www.pollix.at/thymeleaf/shiro">
<head th:include="fragments/head::head"/>
<link rel="stylesheet" th:href="@{/assets/css/colorbox.css}"/>
<link rel="stylesheet" th:href="@{/assets/css/fixedColumns.dataTables.css}"/>
<link rel="stylesheet" th:href="@{/assets/css/jquery.dataTables.min.css}"/>
<link rel="stylesheet" type="text/css" th:href="@{/assets/css/chosen.css}"/>
<style type="text/css">
    .error {
        color: #F00
    }

    .DTFC_LeftBodyLiner {
        height: 910px ! important;
    }

    #sample-table-2 {
        width: 100% !important;
    }


    #sample-table-2_paginate span {
        background-color: #FFFFFF;
    }
</style>
<body style='overflow:visible ! important;'>
<div th:include="fragments/top::top"></div>
<div class="main-container" id="main-container">
    <div class="main-container-inner">
        <div th:include="fragments/left::left" class="sidebar" id="sidebar"></div>
        <div class="main-content">
            <!--<div class="breadcrumbs" id="breadcrumbs">-->
            <!--<ul class="breadcrumb">-->
            <!--<li>首页</li>-->
            <!--<li>学生管理</li>-->
            <!--<li>学生列表</li>-->
            <!--&lt;!&ndash;<li class="active">内容列表</li>&ndash;&gt;-->
            <!--</ul>-->
            <!--</div>-->
            <div class="page-content">
                <div class="row">
                    <div class="col-xs-12">
                        <!-- PAGE CONTENT BEGINS -->
                        <div class="row">
                            <div class="col-xs-12">
                                <h3 class="header smaller lighter blue">代理未审核学生列表</h3>
                                <input type="hidden" name="applyId" id="applyId"
                                       th:value="${#httpServletRequest.getParameter('applyId')}"/>
                                <input type="hidden" name="studentNo" id="studentNo"
                                       th:value="${#httpServletRequest.getParameter('studentNo')}"/>

                                <input type="hidden" name="isAuditor" id="isAuditor" th:value="1"/>
                                <input type="hidden" name="oaid" id="oaid" th:value="${oaid}"/>
                                <input type="hidden" name="status" id="status" th:value="${status}"/>
                                <input type="hidden" name="roleName" id="roleName" th:value="${roleName}"/>

                                <shiro:hasPermission name="visit:list">
                                    <input type="hidden" id="input_hasPermission_visit_list" value="1"/>
                                </shiro:hasPermission>
                                <shiro:hasPermission name="visaApply:list">
                                    <input type="hidden" id="input_hasPermission_visaApply_list" value="1"/>
                                </shiro:hasPermission>
                                <shiro:hasPermission name="两次寄出绩效审核">
                                    <input type="hidden" id="doubleSendingConfirm" value="1"/>
                                </shiro:hasPermission>

                                <shiro:hasRole name="文案经理">
                                    <input type="hidden" id="role_copyManager" value="1"/>
                                </shiro:hasRole>
                                <shiro:hasRole name="签证经理">
                                    <input type="hidden" id="role_visaManager" value="1"/>
                                </shiro:hasRole>
                                <shiro:hasRole name="文签总监">
                                    <input type="hidden" id="role_director" value="1"/>
                                </shiro:hasRole>

                                <div class="table-header">
                                    <form class="form-inline">
                                        <div class="form-group">
                                            <!--<label>代理名称：</label>-->
                                            <!--<input type="text" id="agentName" class="form-control input-sm"-->
                                                   <!--placeholder="" style="width:60px;" onkeyup="changeTable()"/>-->
                                            <!--&lt;!&ndash;<label for="sNo">学号：</label>&ndash;&gt;-->
                                            <!--&lt;!&ndash;<input type="text" id="sNo" class="form-control input-sm"&ndash;&gt;-->
                                            <!--&lt;!&ndash;th:value="${#httpServletRequest.getParameter('studentNo')}"&ndash;&gt;-->
                                            <!--&lt;!&ndash;placeholder="" style="width:60px;" onkeyup="changeTable()"/>&ndash;&gt;-->
                                            <label>姓名/拼音：</label>
                                            <input type="text" id="sName" class="form-control input-sm" placeholder=""
                                                   style="width:60px;" onkeyup="changeTable()"/>
                                            <label>留学国家：</label>
                                            <select class="form-control input-sm" id="selectNation"
                                                    style="width:150px;height:27px;margin:5px 0;" onchange="changeTable()"
                                                    data-placeholder="--请选择留学国家--">
                                                <option></option>
                                                <option th:each="country:${countryInfoList}" th:value="${country.id}"
                                                        th:text="${country.countryName}"></option>
                                            </select>

                                        </div>
                                        <div class="form-group">
                                            <label>状态：</label>
                                            <select type="" class="form-control input-sm" id="auditStatus"
                                                    style="width:100px;" onchange="changeTable()">
                                                <option value="">请选择</option>
                                                <option value="1">未提交</option>
                                                <option value="2">未审核</option>
                                                <!--<option value="3">已审核</option>-->
                                            </select>
                                            <!--<div class="form-group">-->
                                            <!--<label>审批通过日期：</label>-->
                                            <!--<input id="dateStart" class="Wdate" onclick="WdatePicker({dateFmt:'yyyy-MM-dd'})"-->
                                            <!--style="width: 160px;margin:5px 0;height:27px;"-->
                                            <!--required="required"/>-->
                                            <!--&#45;&#45;-->
                                            <!--<input id="dateEnd" class="Wdate" onclick="WdatePicker({dateFmt:'yyyy-MM-dd'})"-->
                                            <!--style="width: 160px;margin:5px 0;height:27px;"-->
                                            <!--required="required"/>-->
                                            <!--</div>-->

                                        </div>
                                        <!--<div class="form-group">-->
                                        <!--<input type="hidden" name="dateStartString" id="dateStart"/>-->
                                        <!--<input type="hidden" name="dateEndString" id="dateEnd"/>-->

                                        <!--</div>-->
                                        <button type="button" id="query" class="btn btn-success"
                                                onclick="changeTable()">查询
                                        </button>
                                        <button  class="btn btn-warning">清空</button>
                                        <a data-toggle="modal" class="btn btn-info pull-right"
                                           href="javascript:void(0);" onclick="toAddURL();">添加学生</a>
                                    </form>

                                </div>


                                <div class="table-responsive">
                                    <div id="alert" class="alert alert-success" style="display: none;" role="alert">
                                        <button type="button" class="close" data-dismiss="alert" aria-label="Close">
                                            <span aria-hidden="true">&times;</span>
                                        </button>
                                        <span id="alertText"></span>
                                    </div>
                                    <table id="sample-table-2" class="table table-striped table-bordered table-hover"
                                           style="white-space: nowrap;">
                                        <thead>
                                        <tr>
                                            <!--<th>学号</th>-->
                                            <th>姓名</th>
                                            <th>拼音</th>
                                            <th>出生日期</th>
                                            <!--<th>代理名称</th>-->
                                            <th>国家</th>
                                            <th>类型</th>
                                            <!--<th>审核时间</th>-->
                                            <th>状态</th>
                                            <th>操作</th>
                                        </tr>
                                        </thead>
                                    </table>
                                    <!--</div>-->
                                    <!--</div>-->
                                </div>
                            </div>
                        </div>
                    </div>
                    <!-- /.col -->
                </div>
                <!-- /.row -->
            </div>
            <!-- /.page-content -->
        </div>

        <div th:include="fragments/bottom::bottom"></div>
    </div>

    <a href="#" id="btn-scroll-up"
       class="btn-scroll-up btn btn-sm btn-inverse"> <i
            class="icon-double-angle-up icon-only bigger-110"></i>
    </a>
</div>
<!-- /.main-container -->

<!-- Modal备注 -->
<div class="modal fade" id="myModal" tabindex="-1" role="dialog"
     aria-labelledby="myModalLabel">
    <div class="modal-dialog" role="document">
        <div class="modal-content"></div>
    </div>
</div>
<div th:include="fragments/js::js"></div>

<script charset="UTF-8" th:src="@{/assets/js/jquery.validate.min.js}"></script>
<script charset="UTF-8" th:src="@{/assets/js/jquery.validate.zh-CN.js}"></script>
<!-- page specific plugin scripts -->
<script charset="UTF-8" th:src="@{/assets/js/1.10.15/jquery.dataTables.min.js}"></script>
<script charset="UTF-8" th:src="@{/assets/js/1.10.15/pagination.input.js}"></script>
<script charset="UTF-8" th:src="@{/assets/js/jquery.dataTables.bootstrap.js}"></script>
<script charset="UTF-8" th:src="@{/assets/js/dataTables.fixedColumns.js}"></script>
<script charset="UTF-8" th:src="@{/assets/js/temp.js}"></script>
<!--图片查看器-->
<script charset="UTF-8" th:src="@{/assets/js/jquery.colorbox-min.js}"></script>
<script charset="UTF-8" th:src="@{/layer/layer.js}"></script>
<script charset="UTF-8" th:src="@{/My97DatePicker/WdatePicker.js}"></script>
<script charset="UTF-8" th:src="@{/assets/js/chosen.jquery.min.js}"></script>
<script charset="UTF-8" th:src="@{/assets/js/date-time/bootstrap-datepicker.min.js}"></script>
<script charset="UTF-8" th:src="@{/assets/js/date-time/bootstrap-timepicker.min.js}"></script>
<script charset="UTF-8" th:src="@{/business/student/studentList.js}"></script>
</body>
<!--<script th:src="@{/assets/js/date-time/moment.min.js}"></script>-->
<script type="text/javascript">
    <!--
    var oTable1;
    $("#sStatus").val($("#status").val());

    jQuery(function ($) {

        oTable1 = $('#sample-table-2').dataTable({

            "bFilter" : false,//是否使用搜索
            "bProcessing" : true,
            "bDeferRender" : true,//
            "sPaginationType" : "bs_normal",//分页样式
            "bRetrieve" : true,//是否调用后台
            "bServerSide" : true,//是否以后台分页
            "bAutoWidth": true,
            "sAjaxSource": "/toAuditListTY_query",//请求路径
            "fnServerData": function (sSource, aoData, fnCallback) {
                aoData.push(
//                    {name: 'studentNo', value: $("#sNo").val() == "" ? null : $.trim($("#sNo").val())},
//                    {name: 'studentName', value: $("#sName").val() == "" ? null : $.trim($("#sName").val())},
//                    {
//                        name: 'studentStatus',
//                        value: $("#sStatus").find("option:selected").val() == "" ? null : $("#sStatus").find("option:selected").val()
//                    },
//                    {name: 'dateStart', value: $("#dateStart").val() == "" ? null : $.trim($("#dateStart").val())},
//                    {name: 'dateEnd', value: $("#dateEnd").val() == "" ? null : $.trim($("#dateEnd").val())}
                    {name: 'agentName', value: $("#agentName").val() == "" ? null : $.trim($("#agentName").val())},
                    {name: 'studentName', value: $("#sName").val() == "" ? null : $.trim($("#sName").val())},
                    {
                        name: 'auditStatus',
                        value: $("#auditStatus").find("option:selected").val() == "" ? null : $("#auditStatus").find("option:selected").val()
                    },
                    {
                        name: 'nationId',
                        value: $("#selectNation").val() == "" ? null : $.trim($("#selectNation").val())
                    },
                    {name: 'type', value:"DL"}


                )
                $.ajax({
                    "dataType": 'json',
                    "type": "POST",
                    "url": sSource,
                    "data": aoData,
                    "success": fnCallback
                });
            },
            // "aaSorting": [[0, "desc"]],
            "bSort": false,
            "aoColumns": [
//                {
//                    "sClass": "center", "bSortable": false, "mData": function (data) {
//                    var studentDetail = '<a class="blue" href="javascript:void(0);" onclick="toStudentDetail(\'' + data.studentNo + '\')">' + data.studentNo + '</a>';
//                    return studentDetail;
//                }
//                },
                {"sClass": "center", "bSortable": false, "mData":
                    function (data) {
                        var toEditUrl = '<a class="blue" href="javascript:void(0);" onclick="toEditUrl(\'' + data.id + '\')">' + data.studentName + '</a>';
                        return toEditUrl;
                    }},
                {"sClass": "center", "bSortable": false, "mData": "pinyin"},
                {"sClass": "center", "bSortable": false, "mData":
                    function (data) {
                        if (data.birthday != null) {
                            return getTimeString_day(new Date(data.birthday))
                        } else {
                            return "";
                        }
                    }},
//                {"sClass": "center", "bSortable": false, "mData": "agentName"},
                {
                    "sClass": "center", "bSortable": false, "mData":
                    function (data) {
                        if (data.nationName == "美高") return "美国";
                        if (data.nationName == "美普") return "美国";
                        else return data.nationName;
                    }
                },
                {"sClass": "center", "bSortable": false, "mData":
                    function (data) {
                        if (data.contractType == 1) return "全程";
                        if (data.contractType == 4) return "单签证";
                        else return "";
                    }
                },
//                {"sClass": "center", "bSortable": false, "mData":
//                    function (data) {
//                        if (data.signDate != null) {
//                            return getTimeString_day(new Date(data.signDate))
//                        } else {
//                            return "";
//                        }
//                    }},
                {"sClass": "center", "bSortable": false, "mData":
                    function (data) {
                        if (data.auditStatus == 1) {
                            return "未提交";
                        } else if (data.auditStatus == 2) {
                            return "未审核";
                        } else if (data.auditStatus == 3) {
                            return "已审核";
                        } else {
                            return "";
                        }

                    }},
                {"sClass": "center", "bSortable": false, "mData":
                    function(data){
                        if(data.auditStatus == 1){
                            return '<a href="javascript:void(0);"  onclick="toUpdate(\'' + data.id +'\')">提交</a>';
                        }else{
                            return "";
                        }
                    }
                }
            ],
            "oLanguage": {
                "sLengthMenu": "每页 _MENU_条 ",
                "sZeroRecords": "对不起，查询不到任何相关数据",
                "sInfo": "当前显示 _START_ 到 _END_ 条，共 _TOTAL_ 条记录 ",
                "sInfoEmpty": "显示 0 到 0 条，共 0 条记录",
                "sInfoFiltered": "数据表中共为 _MAX_ 条记录)",
                "sProcessing": "正在加载中...",
                "sSearch": "搜索",
                "sUrl": "", //多语言配置文件，可将oLanguage的设置放在一个txt文件中，例：Javascript/datatable/dtCH.txt
                "oPaginate": {
                    "sFirst": "第一页",
                    "sPrevious": " 上一页 ",
                    "sNext": " 下一页 ",
                    "sLast": " 最后一页 "
                }
            }
            //多语言配置

        });


        //页面响应回车事件
        $(document).keyup(function (e) {//捕获文档对象的按键弹起事件
            if (e.keyCode == 13) {//按键信息对象以参数的形式传递进来了
                $("#query").click();
            }
        });

        $("#empty").click(function () {
            $("#selectNation").empty();
            $("#selectBranch").empty();
            $("#dateStart").val("");
            $("#dateEnd").val("");
            $("#visaSendDate_Start").val("");
            $("#visaSendDate_End").val("");
            $("#visaOperatorDate_Start").val("");
            $("#visaOperatorDate_End").val("");
            location.href = '/toAuditListTY';
        })

        function getTimeString_day(date) {
            var y = date.getFullYear();
            var m = date.getMonth() + 1;
            m = m >= 10 ? m : '0' + m;
            var d = date.getDate();
            d = d >= 10 ? d : '0' + d;
            return y + '-' + m + '-' + d;
        }

    })

    function changeTable() {
        oTable1.fnDraw()
    }

    function toAddURL() {
        location.href='channelStudent/addPage';
    }

    function toEditUrl(id) {
        location.href='channelStudent/editPage?id='+id;
    }

    function toUpdate(id){
        layer.confirm('是否确认提交？', {
            btn: ['确认', '取消'] //按钮
        }, function () {
            //加载框
            var loadIndex = layer.load(1, {shade: [0.5, '#393D49']});
            $.ajax({
                url: "/channelStudent/edit",
                type: "post",
                data: {
                    id: id,
                    auditStatus: 2,
                },
                success: function (data) {
                    layer.closeAll();
                    if (data) {
                        oTable1.fnDraw();
                    } else {
                        layer.msg('操作失败', {time: 1000});
                    }
                }
            });
        }, function () {
            layer.close();
        });

    }


    -->

</script>

</html>
